using Circus.CodeEditor;

using System;
using System.ComponentModel;
namespace Circus.Syntax.CodeCompletion
{
	public class CodeSnippetLiteral : ICodeSnippetLiteral, IComparable
	{
		private string defaultValue = string.Empty;
		private string function = string.Empty;
		private string id = string.Empty;
		private string toolTip = string.Empty;
		private bool editable = true;
		private string type = string.Empty;
		public virtual string Default
		{
			get
			{
				return this.defaultValue;
			}
			set
			{
				if (this.defaultValue != value)
				{
					this.defaultValue = value;
					this.OnDefaultChanged();
				}
			}
		}
		public virtual string Function
		{
			get
			{
				return this.function;
			}
			set
			{
				if (this.function != value)
				{
					this.function = value;
					this.OnFunctionChanged();
				}
			}
		}
		public virtual string ID
		{
			get
			{
				return this.id;
			}
			set
			{
				if (this.id != value)
				{
					this.id = value;
					this.OnIDChanged();
				}
			}
		}
		public virtual string Type
		{
			get
			{
				return this.type;
			}
			set
			{
				if (this.type != value)
				{
					this.type = value;
					this.OnTypeChanged();
				}
			}
		}
		public virtual string ToolTip
		{
			get
			{
				return this.toolTip;
			}
			set
			{
				if (this.toolTip != value)
				{
					this.toolTip = value;
					this.OnToolTipChanged();
				}
			}
		}
		public virtual bool Editable
		{
			get
			{
				return this.editable;
			}
			set
			{
				if (this.editable != value)
				{
					this.editable = value;
					this.OnEditableChanged();
				}
			}
		}
	 
		protected virtual void OnDefaultChanged()
		{
		}
		protected virtual void OnFunctionChanged()
		{
		}
		protected virtual void OnIDChanged()
		{
		}
		protected virtual void OnTypeChanged()
		{
		}
		protected virtual void OnToolTipChanged()
		{
		}
		protected virtual void OnEditableChanged()
		{
		}
		public virtual int CompareTo(object value)
		{
			if (value is ICodeSnippetLiteral)
			{
				return string.Compare(this.id, ((ICodeSnippetLiteral)value).ID, true);
			}
			throw new ArgumentException();
		}
	}
}
